<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/3/31
  Time: 21:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>图书在线借阅系统</title>
    <link rel="stylesheet" type="text/css" href="lib/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="lib/layui/css/book.css">
    <script type="text/javascript" src="lib/layui/layui.js"></script>
    <style>
        body {
            background: url("lib/Images/bg-3.jpg") no-repeat;
            background-size: cover;
        }
    </style>
</head>
<body>
<div class="layui-container-box" style="width: 500px;background-color: #cccccc;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>会员充值</legend>
    </fieldset>
    <form action="member.let?type=Rechange" class="layui-form" method="post" style="margin-left: 20px">
        <div class="layui-form-item">
            <label class="layui-form-label">卡号</label>
            <div class="layui-input-block">
                <input type="text" name="memId" lay-verify="memId" autocomplete="off" placeholder="请输入卡号" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">充值金额</label>
            <div class="layui-input-block">
                <input type="text" name="rechange" lay-verify="number" autocomplete="off" placeholder="请输入充值金额" class="layui-input">
            </div>
        </div>




        <div class="layui-form-item">
            <div class="layui-input-block" style="position: relative;">
                <button class="layui-btn" lay-submit="" lay-filter="demo1" style="width: 80px;position:absolute; left: -150px;bottom: -5px">立即提交</button>
                <button type="reset" class="layui-btn" style="width: 80px;position: absolute; bottom: -5px;right: 120px">重置</button>
            </div>
        </div>
    </form>
</div>
</body>
</html>
<script type="text/javascript">
    layui.use('form',function () {
        var form = layui.form;
        //自定义验证规则
        form.verify({
            // username: function(value){
            //     if(value.length == 0){
            //         return "用户名不能为空";
            //     }
            // },
            //
            // isExist:function(value){
            //     var params = {"memId":value };
            //     var data;
            //     $.ajax({
            //         url:'member.let?type=VerifyId',
            //         contentType: "application/json",
            //         dataType:'json',
            //         type: "post",
            //         async: false,
            //         data: JSON.stringify(params),
            //         success: function(result) {
            //             data = result.flag;
            //
            //         },
            //
            //     });
            //     if (data.flag) {
            //         return '用户id已存在';
            //     }
            //
            // },

            memId:[/^\d{0,7}$/,"卡号必须是0~7位数字"]

        })
    })
</script>


